import { AppRouteRecordRaw } from '@/types/routes/index';

// 引入模块的default 导出
const modules = import.meta.glob(['./*.ts', '!./index.ts'], {
	eager: true,
	import: 'default',
});
// 引入模块路由
const moduleRoutes = values(modules).flatMap((module: any) => {
	return isArray(module) ? [...module] : [module];
});
const bussinessRoutes: AppRouteRecordRaw[] = [
	{
		path: '/app',
		component: () => import('@/views/layouts/basic-layout.vue'),
		children: [
			{
				path: '',
				component: () => import('@/views/index.vue'),
			},
			...moduleRoutes,
		],
	},
];

export default bussinessRoutes;
